#include "processBar.h"
#include <string.h>
#include <unistd.h>

void processbar()
{
    int cnt = 0;
    char bar[NUM];
    memset(bar, '\0', sizeof(bar));
    const char* lable = "|/-\\";
    int len = strlen(lable);
    while(cnt <= 100)
    {
        printf("[%-100s][%d%%][%c]\r", bar, cnt, lable[cnt%len]);
        fflush(stdout);
        bar[cnt++] = STYLE;
        if(cnt < 100)
            bar[cnt] = '>';
        usleep(100000);
    }
    printf("\n");
    return;
}
